#!/usr/bin/env python
#coding:utf-8

import math

def isP(x):
    if x == 2:
        return 1
    if x % 2 ==0:
        return 0
    for n in range(3, int(math.sqrt(x)+2), 2):
        if x % n == 0:
            return 0

    return 1

if __name__ == '__main__':
    print '1000以内的素数是：'
    m = filter(isP,range(2, 1000))
    print m, len(m)
